// 原始类型
export let bool: boolean = true;
export let num: number = 613;
export let str: string = 'hello world';

// 数组
export let arr1: number[] = [1, 2, 3, 4, 5];
export let arr2: Array<number> = [1, 2, 3, 4, 5];
export let arr3: Array<number | string> = [1, 2, 3, 4, '5'];

// 元组
export let tuple: [number, string] = [0, '1'];

// 函数
export let add = (x: number, y: number): number => x + y;
export let compute: (x: number, y: number) => number;
compute = (x, y) => x + y;

// 对象
export let obj: { x: number, y: number } = {x: 1, y: 2};
obj.x = 2;

// symbol
export let s1: symbol = Symbol();
export let s2 = Symbol();


// undefined, null
export let un: undefined = undefined;
export let nu: null = null;

// void
export let noReturn = () => {
};

// any, default is any
export let y: any;

// never
export let error = () => {
  throw new Error('error');
};

export let endless = () => {
  while (true) {
  }
};

export let x: number | null | undefined = 613;

